<?php
// $Id$
/**
 * This file contains {@link LockCapabilities} which is part of the PHP Content
 * Repository (phpCR), a derivative of the Java Content Repository JSR-170,  
 * and is licensed under the Apache License, Version 2.0.
 *
 * This file is based on the code created for
 * {@link http://www.jcp.org/en/jsr/detail?id=170 JSR-170}
 *
 * @author Travis Swicegood <travis@domain51.net>
 * @copyright PHP Code Copyright &copy; 2004-2005, Domain51, United States
 * @copyright Original Java and Documentation 
 *  Copyright &copy; 2002-2004, Day Management AG, Switerland
 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, 
 *      Version 2.0
 * @package phpContentRepository
 * @subpackage Level2
 */

/**
 * Load the {@link phpCR} library file(s)
 */ 
require_once(dirname(__FILE__) . '/../phpCR.library.php');
phpCR::loadInterface('Lock', '/lock');


/**
 * Allows discovery of locking support.
 *
 * Level 2 only
 *
 * Returned by {@link Workspace::getLockCapabilities()}. Provides information
 * about what locking features are supported by this implementation.
 *
 * @see Workspace::getLockCapabilities()
 * @author PHP - Travis Swicegood <travis@domain51.net>
 * @copyright Copyright &copy; 2004-2005, Domain51
 * @package phpContentRepository
 * @subpackage Level2
 */
interface LockCapabilities 
{
   /**
    * Reports whether exclusive locks are supported by this implementation.
    *
    * @return bool 
    *   TRUE if exclusive locks are supported; FALSE
    *   otherwise.
    */
    public function isExclusiveLockSupported();
    
    
   /**
    * Reports whether shared locks are supported by this implementation.
    *
    * @return bool
    *   TRUE if shared locks are supported; FALSE
    *   otherwise.
    */
    public function isSharedLockSupported();
    
    
   /**
    * Reports whether locking at the the level of individual properties is
    * supported by this implementation.
    *
    * @return bool
    *   TRUE if property locking is supported; FALSE
    *   otherwise.
    */
    public function isPropertyLockSupported();
    
    
   /**
    * Reports the supported lock types. If locking is supported at all, this
    * will include at least {@link LockType::WRITE_LOCK}. If other lock types
    * are also supported then these are returned as well.
    *
    * @return array
    *   An array of {@link LockType} objects representing all supported lock 
    *   types.
    */
    public function getSupportedLockTypes();
}

